package com.nthink.indicators.controller;

import com.nthink.indicators.pojo.condition.TimeCondition;
import com.nthink.indicators.pojo.hospitalindicators.PatientTreatmentFee;
import com.nthink.indicators.pojo.hospitalindicators.ResourceAllocation;
import com.nthink.indicators.pojo.pie.PieDataModel;
import com.nthink.indicators.service.hospitalindicators.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Angus Yu
 * @date 2021-03-29 11:52
 */
@Api(tags = "医院指标")
@RestController
public class HospitalIndicatorsController {

    @Autowired
    private ResourceAllocationService resourceAllocationImpl;

    @Autowired
    private HumanResourcesService humanResourcesService;

    @Autowired
    private PatientTreatmentFeeService patientTreatmentFeeService;

    @ApiOperation("资源配置(办公室)饼图数据")
    @GetMapping("/getResourceAllocationList")
    public List<PieDataModel> getResourceAllocationList() {
        return resourceAllocationImpl.getResourceAllocation();
    }

    @ApiOperation("资源配置(办公室)数据")
    @GetMapping("/getResourceAllocation")
    public ResourceAllocation getResourceAllocation() {
        ResourceAllocation resourceAllocation = resourceAllocationImpl.getData();

        return resourceAllocation;
    }


    @ApiOperation("人力资源")
    @GetMapping("/getHumanResources")
    public List<PieDataModel> getHumanResources() {
        return humanResourcesService.getHumanResourcesPie();
    }

    @ApiOperation("卫生技术人员职称构成比")
    @GetMapping("/getPie1")
    public List<PieDataModel> getPie1() {
        return humanResourcesService.getPie1();
    }


    @ApiOperation("麻醉人员职称构成比")
    @GetMapping("/getPie2")
    public List<PieDataModel> getPie2() {
        return humanResourcesService.getPie2();
    }

    @ApiOperation("药学专业技术人员构成比")
    @GetMapping("/getPie3")
    public List<PieDataModel> getPie3() {
        return humanResourcesService.getPie3();
    }

    @ApiOperation("患者诊治费")
    @GetMapping("/getPatientTreatmentFee")
    public PatientTreatmentFee getPatientTreatmentFee(TimeCondition timeCondition) {
        return patientTreatmentFeeService.getData(timeCondition);
    }

}




